#!/bin/bash
CURRENT=$(pwd)

echo "Stream-1: ${STREAM_SRC_1}"
# 启动第一个流
nohup ffmpeg -rtsp_transport tcp -hwaccel cuda -i ${STREAM_SRC_1} -c:v h264_nvenc -pix_fmt yuv420p -f rtsp rtsp://0.0.0.0:8554/stream1 &> "${CURRENT}/stream1.log" &


echo "Stream-2: ${STREAM_SRC_2}"
# 启动第二个流
nohup ffmpeg -rtsp_transport tcp -hwaccel cuda -i ${STREAM_SRC_2} -c:v h264_nvenc -pix_fmt yuv420p -f rtsp rtsp://0.0.0.0:8554/stream2 &> "${CURRENT}/stream2.log" &


echo "Stream-3: ${STREAM_SRC_3}"
# 启动第三个流
nohup ffmpeg -rtsp_transport tcp -hwaccel cuda -i ${STREAM_SRC_3} -c:v h264_nvenc -pix_fmt yuv420p -f rtsp rtsp://0.0.0.0:8554/stream3 &> "${CURRENT}/stream3.log" &


echo "Stream-4: ${STREAM_SRC_4}"
# 启动第四个流
nohup fmpeg -rtsp_transport tcp -hwaccel cuda -i ${STREAM_SRC_4} -c:v h264_nvenc -pix_fmt yuv420p -f rtsp rtsp://0.0.0.0:8554/stream4 &> "${CURRENT}/stream4.log" &
